package com.hzw.saas.service.storage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hzw.saas.service.storage.model.ResourceFile;
import com.hzw.saas.service.storage.pojo.FileStorageInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 资源表 Mapper 接口
 * </p>
 *
 * @author zzl
 * @since 2020-12-24
 */
@Mapper
public interface ResourceFileMapper extends BaseMapper<ResourceFile> {

    IPage<ResourceFile> pageColdFiles(Page<?> page, @Param("spaceIds") List<String> spaceIds, @Param("geDate") Date geDate, @Param("ltDate") Date ltDate);

    IPage<ResourceFile> pageHotFiles(Page<?> page, @Param("spaceIds") List<String> spaceIds, @Param("geDate") Date geDate, @Param("ltDate") Date ltDate);

    IPage<ResourceFile> pageDeletedFiles(Page<?> page, @Param("spaceIds") List<String> spaceIds, @Param("geDate") Date geDate, @Param("ltDate") Date ltDate);

    IPage<ResourceFile> pagePicturesNoneThumbnails(Page<?> page, @Param("types") Collection<String> types, @Param("minSize") Long minSize);

    void updateBatchFileStorageInfo(@Param("storageList")List<FileStorageInfo> storageList);

    void updateSupIdInRoot();
}
